package com.njtoyo.taxi.admin.rest.controller.business.operation_rule;

import com.njtoyo.taxi.admin.rest.wrapper.business.operation_rule.call_prepay_rule.CallPrepayRuleAddUpdateWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.business.operation_rule.dispatch_rule.DispatchFormDataWrapper;
import com.njtoyo.taxi.admin.service.business.operation_rule.CallDispatchRuleService;
import com.taxi.entity.common.RestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 派单
 */
@RestController
@RequestMapping("/business/operation-rule/call-dispatch-rule")
public class CallDispatchRuleController {

    @Autowired
    private CallDispatchRuleService callDispatchRuleService;

    @GetMapping("/detailByRegionId/{regionId}")
    public RestResult detailByRegionId(@PathVariable("regionId") Long regionId) {
        return callDispatchRuleService.getDetailByRegionId(regionId);
    }

    @PostMapping("/set")
    public RestResult set(@RequestBody DispatchFormDataWrapper formData) {
        return callDispatchRuleService.set(formData);
    }
}
